﻿<Window
     xmlns:XbdSoftView="clr-namespace:XbdSoft.WPFVersion.View"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:effect="clr-namespace:XbdSoft.WPFVersion.Effect"
        xmlns:WPFVersion ="clr-namespace:XbdSoft.WPFVersion"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        mc:Ignorable="d" x:Class="XbdSoft.WPFVersion.GlassMainWindow" 
        Title="MainWindow" Height="489" Width="744"  
        effect:GlassEffect.IsEnabled="True"
        Loaded="Window_Loaded" >

    <Window.Resources>
        <Style x:Key="imageButton" TargetType="Button">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Border BorderThickness="1,0,1,0" BorderBrush="Gray" Background="{TemplateBinding Background}">
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </Window.Resources>
    <Border CornerRadius="3" Height="Auto" BorderBrush="#FF214BCE" BorderThickness="1">
        <Border.Background>
            <LinearGradientBrush EndPoint="0.5,1" MappingMode="RelativeToBoundingBox" StartPoint="0.5,0">
                <GradientStop Color="#FF214BCE"/>
                <GradientStop Color="#FFDADCF3" Offset="1"/>
                <GradientStop Color="#FFE3E6EF" Offset="0.141"/>
            </LinearGradientBrush>
        </Border.Background>
        <Grid Margin="0">
            <Grid.RowDefinitions>
                <RowDefinition Height="20"/>
                <RowDefinition Height="*"/>
                <RowDefinition Height="20"/>
            </Grid.RowDefinitions>
            <Border BorderThickness="1" Margin="0" CornerRadius="3" Height="22" MouseLeftButtonDown="DragWindow">
                <Border.Background>
                    <LinearGradientBrush EndPoint="0.457,2.143" StartPoint="0.457,0">
                        <GradientStop Color="#FF4ECB99" Offset="1"/>
                        <GradientStop Color="#FF062CFD" Offset="0.936"/>
                        <GradientStop Color="#FF50CF98" Offset="1"/>
                        <GradientStop Color="Black" Offset="1"/>
                        <GradientStop Color="#FF2672D1" Offset="0.223"/>
                    </LinearGradientBrush>
                </Border.Background>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="31"/>
                        <ColumnDefinition Width="31"/>
                    </Grid.ColumnDefinitions>
                    <TextBlock Foreground="White" FontWeight="Bold">小布叮软件</TextBlock>
                    <Button Grid.Column="2"  Cursor="Hand"  Width="31"  ToolTip="关闭"  BorderThickness="0,0" Style="{StaticResource imageButton}" Click="CloseButton_Click">
                        <Button.Background>
                            <ImageBrush ImageSource="Images/close.gif"></ImageBrush>
                        </Button.Background>
                    </Button>
                    <Button x:Name="Button"  Cursor="Hand" ToolTip="最小化"  BorderThickness="0" Grid.Column="1"  Click="MinButton_Click" Style="{StaticResource imageButton}">
                        <Button.Background>
                            <ImageBrush ImageSource="Images/min.png"></ImageBrush>
                        </Button.Background>
                    </Button>
                </Grid>
            </Border>
            <TabControl Name="MainTabControl" SelectionChanged="TabControl_SelectionChanged" HorizontalAlignment="Stretch" Grid.Row="1" Grid.Column="0" VerticalAlignment="Stretch" Panel.ZIndex="1"  >
                <TabItem Name="InfoTabItem" Header="资讯" Background="LightGray" >
                    <WebBrowser  x:Name="InfoWebBrowser" />
                </TabItem>
                <TabItem Name="DownloadTabItem" Header="下载" >
                    <XbdSoftView:DownloadView x:Name="downloadView"></XbdSoftView:DownloadView>
                </TabItem>
            </TabControl>
            <Border BorderBrush="#FF214BCE" BorderThickness="1" Margin="0,-2,0,0" Grid.Row="2" CornerRadius="3">
                <Border.Background>
                    <LinearGradientBrush EndPoint="0.457,2.143" StartPoint="0.457,0">
                        <GradientStop Color="#FF4ECB99" Offset="1"/>
                        <GradientStop Color="#FF062CFD" Offset="0.933"/>
                        <GradientStop Color="#FF50CF98" Offset="1"/>
                        <GradientStop Color="Black" Offset="1"/>
                        <GradientStop Color="#FF2B7ECA" Offset="0.456"/>
                    </LinearGradientBrush>
                </Border.Background>
            </Border>

            <WPFVersion:NotifyIcon
			x:Name="notifyIcon"
			Text="Text"
			Icon="Images/favicon.ico"
			BalloonTipText="TipText"
			BalloonTipTitle="TipTitle"
			BalloonTipIcon="Info"
			MouseDoubleClick="OnNotifyIconDoubleClick">
                <WPFVersion:NotifyIcon.ContextMenu>
                    <ContextMenu>
                        <MenuItem Header="Open" Click="OnOpenClick" />
                        <MenuItem Header="Hide" Click="OnHideClick" />
                        <MenuItem Header="Exit" Click="OnExitClick" />
                    </ContextMenu>
                </WPFVersion:NotifyIcon.ContextMenu>
            </WPFVersion:NotifyIcon>

        </Grid>
    </Border>
</Window>
